// sample_1.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"
#include "sample1.h"
#include "hgeGuiWindow.h"
#include "hgeGuiWindowManager.h"
#include "hgeGuiSystem.h"
#include "hgeFontManager.h"
#include "hgeImageManager.h"
#include "../common/hgeApplication.h"

int main(int argc, char* argv[])
{
	Demo6Sample app;
	return app.run();
}

/*************************************************************************
Sample specific initialisation goes here.
*************************************************************************/
bool Demo6Sample::initialiseSample()
{
	// we will use of the WindowManager.
	WindowManager& winMgr = WindowManager::getSingleton();

	// load scheme and set up defaults
	System::getSingleton().setDefaultMouseCursor("MouseArrow");
	FontManager::getSingleton().createFont("simkai", "E:/hgeextend/tutorials/precompiled/simkai.ttf", 14.0f, true);

	// load an image to use as a background
	ImageManager::getSingleton().createImageFromFile("BackgroundImage", "E:/hgeextend/tutorials/precompiled/bg2.png");

	// here we will use a StaticImage as the root, then we can use it to place a background image
	Window* background = winMgr.createWindow("DefaultWindow", "root_wnd");
	// set position and size
	background->setPosition(0, 0);
	background->setSize(800, 600);
	// disable frame and standard background
	background->setProperty("RendererProperty", "Renderers/StaticImage");
	//background->setProperty("FrameEnabled", "false");
	//background->setProperty("BackgroundEnabled", "false");
	// set the background image
	background->setProperty("Image", "set:BackgroundImage image:full_image");
	background->setSize(64, 64);
	background->setImageryState("Enabled", "BackgroundImage");	
	// install this as the root GUI sheet
	System::getSingleton().setGUISheet(background);

	// success!
	return true;
}

/*************************************************************************
Cleans up resources allocated in the initialiseSample call.
*************************************************************************/
void Demo6Sample::cleanupSample()
{
	// nothing to do here!
}